package com.biluo.main.daoru;

import com.biluo.PathUtils;
import com.biluo.comman.DaoruBookCount;

import java.awt.GraphicsConfiguration;
import java.io.File;

import javax.swing.JFileChooser;





public class DaoRuView {
	private static final GraphicsConfiguration String = null;

	public void  go(){
		
		String sourcePath;
	  	JFileChooser jfc = new JFileChooser("c:/");
		jfc.showOpenDialog(null);
		File sf = jfc.getSelectedFile();
		sourcePath = sf.getAbsolutePath();//�õ�Դ�ļ���·��
		
	    String[] names = sourcePath.split("\\\\");
	    String yuanlaiName = names[names.length-1];

	    int count = Integer.parseInt( DaoruBookCount.getCount(PathUtils.getResourcePath()+"/mybook/daorubookCount.properties") );
	   // System.out.println(count);
	    count++;
	    String countValue = count+"";
	    DaoruBookCount.setCount(countValue,PathUtils.getResourcePath()+"/mybook/daorubookCount.properties");
	    

	    String targetPath = PathUtils.getResourcePath() + "/mybooks/"+countValue+"/";
	    //System.out.println(targetPath);
	    SplitFileAndSave split = new SplitFileAndSave();
	    split.splitfileandsave(sourcePath, targetPath,yuanlaiName);
	    
	 
		
	}
}
